package Date1201;
import  java.util.Scanner;
    public class Demo1{
        public static void main(String[] args){
            
            Scanner sc = new Scanner(System.in);
            String str = sc.nextLine();
            sc.close();
            int num = 0;
            for(int i=0;i<str.length();i++){
                char a = str.charAt(i);
                if(a=='A'){
                    num++;
                }
        }
            System.out.println(num);
        }
    }